/**
 * Created by Laggo on 11/5/15.
 */
app.directive("cdschoseseller", ['sellService',function (sellService) {
    return {
        restrict: 'E',
        templateUrl: 'www/html/directive/choseSeller.html',
        replace: true,
        transclude: true,
        scope: {
            parentrealname:'=',
            parentid:'='

        },
        link: function (scope, ele, attr) {

            scope.parm = {
                currentPage: 1,
                realName_like: '',
                pageSize: 10
            }


            scope.submit = function (e) {
                scope.parm.currentPage = e;
                sellService.list(scope.parm)
                    .then(function (result) {
                       console.log(result);
                        scope.parm.totalSize = result.totalSize;
                        scope.sallerList = result.resultData;
                    })
            }

            scope.submit(1);

            scope.chose = function (id, name) {
                console.log(id,name)
                scope.parentid = id;
                scope.parentrealname = name;
            }
        },
    }
}]);
